Sets the WHOLE raw attribute byte (class bits AND every project-defined flag bit at once) at (x, y) - the setter twin of tile_flags. Reach for this instead of tile_set_class when a project needs to change one of its own flag bits (a “wet”/“hurt” bit, say) without disturbing - or while also choosing - the class in the same call.
Works differently on Game Boy - The game keeps at most 16 changed squares of a room at once (32 with tile_set_index, 48 with autotiles) until the player leaves; a change that finds no free place does nothing, and nothing tells you.
Works differently on Game Boy Color - The game keeps at most 16 changed squares of a room at once (32 with tile_set_index, 48 with autotiles) until the player leaves; a change that finds no free place does nothing, and nothing tells you.
On other consoles this differs: see Side by side and How the consoles differ.
tile_set_flags(x, y, flags)| Name | Type |
|---|---|
x | real |
y | real |
flags | int |
Nothing.
Sets the whole raw attribute byte (the class bits and every project-defined flag bit, all at once) at (x, y) - the setter twin of tile_flags. Reach for this instead of tile_set_class when a project needs to change one of its own flag bits (a "wet" or "hurt" bit, say) without disturbing - or while also choosing - the class in the same call. A floor that becomes wet after a burst pipe, or a patch that stops being hurtful once a fire burns out, are both this call flipping one project-defined bit while leaving the class untouched.
x and y are a place in the room, counted from the room's top-left corner. That is also where the tile grid starts, so the very first tile covers x from 0 to 7 and y from 0 to 7 (tiles are 8 by 8 pixels).
Same no-op conditions as tile_set_class, and the same collision-only, does-not-persist limits - this changes what a tile blocks or how a project's own code reads it, never what is drawn. See tile_set_class for that distinction in full, and tile_anim_frame for the actual, separate way to change a tile's art. For a change that should stay after the room is left, see collision layers.
var flags = tile_flags(x, y);
tile_set_flags(x, y, flags | FLAG_WET);Reads the raw flag byte under the walker and sets the flag called wet on it, leaving whether the tile blocks and every other flag exactly as they were. FLAG_WET is the word for the tile flag you named wet (see tile flags). To clear a flag instead of setting it, write flags & ~FLAG_WET. The first two bits of the byte are always the tile class, so a flag number is never 1 or 2. See tile_flags.
On the Game Boy Color and the original Game Boy, a room keeps a list of the squares changed from the picture it was painted with. The list is as long as the number of different squares your code names with plain numbers, at least 32 (16 when only the class or flags change) and at most 255. A square put back to its painted tile gives its place back. A square your code works out while the game runs (from a variable or a loop) counts only toward the 32. A change that finds no free place is not drawn. On the Game Boy Color and the Game Boy, a game that changes more than 255 squares of a room sets Project Settings > Engine limits > Changed squares at once; up to the room's size is then kept.
Same no-op conditions, and the same “collision only, does not persist” limits, as tile_set_class - see that entry.